/*
 * Copyright (c) 2020, 2023, 3044483124@qq.com All rights reserved.
 *
 */
package itcast;

/**
 * <p>Project: JavaStudy - Opt1
 * <p>Powered by jiangbo On 2023-01-31
 * 14:45:09
 * <p>Created by IntelliJ IDEA
 *
 * @author jiangbo [3044483124@qq.com]
 * @version 1.0
 * @since 8/17
 */
public class Opt1 {
    public static void main(String[] args) {
        int a = 10;
        int b = 2;
        System.out.printf("%d + %d = %d%n", a, b, a + b);
        System.out.printf("%d - %d = %d%n", a, b, a - b);
        System.out.printf("%d × %d = %d%n", a, b, a * b);
//求整商
        System.out.printf("%d ÷ %d = %d%n", a, b, a / b);
//求余数
        System.out.printf("%d %% %d = %d%n", a, b, a % b);
        int c = 5;
//变量自身值加1
        ++c;
        System.out.println(c);
//d = 6,c = 7

        int d = c++;
//int d = ++c;
        System.out.println(c);
        System.out.println(d);
        d--;
        System.out.println(d);
        System.out.println(--d);
    }
}


